-
Notifications
You must be signed in to change notification settings - Fork 201
@W-19425801 Guest Shopper Flow #3417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@W-19425801 Guest Shopper Flow #3417
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| "license": "See license in LICENSE", | ||
| "dependencies": { | ||
| "commerce-sdk-isomorphic": "4.0.1-preview-shopper-configurations.0", | ||
| "commerce-sdk-isomorphic": "4.0.0-nightly-20251016080758", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a PR SalesforceCommerceCloud/commerce-sdk-isomorphic#235 that will generate a new preview release once merged. I need to update the version here since we need the changes in that new release for this PR.
| ) => { | ||
| if (items?.length) { | ||
| const payload = items.map((item) => { | ||
| const productId = item.productId || item.product_id || item.id || item.product?.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do all these variations come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it somehow stem from ocapi vs scapi response? Wonder if we should 'normalize' the object prior tothis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list products vs get product API response differences. would be nice to have a centralized normalization function
| import {useShopperBasketsMutation} from '@salesforce/commerce-sdk-react' | ||
|
|
||
| // Dev-only debug logger to keep recovery silent in production | ||
| const devDebug = (...args) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this live somewhere others can use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hook was created as a fallback when the merge basket is not available. It creates a new basket and copies everything from the merge basket to the newly created basket. We want to avoid using this hook if possible. It will be explored in a different ticket. I will leave the comments for this file as-is for now.
| let hydrated = null | ||
| try { | ||
| hydrated = await api.shopperBaskets.getBasket({ | ||
| headers: {authorization: `Bearer ${auth.get('access_token')}`}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this sort of thing the responsibility of the SDK? I haven't seen any other API requests have inline token management. Why exactly is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow the user context isn't refreshed when a guest becomes a registered user and we get stale basket or we lose the merged basket. This is an attempt to get the registered user's basket by explicitly specifying the access token. We will be re-visiting the logic in this file in another ticket. I will leave this as-is for now.
packages/template-retail-react-app/app/pages/checkout-one-click/partials/one-click-payment.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/pages/checkout-one-click/partials/one-click-payment.jsx
Outdated
Show resolved
Hide resolved
...ail-react-app/app/pages/checkout-one-click/partials/one-click-shipping-address-selection.jsx
Show resolved
Hide resolved
…01.guestCustFlow' into syadupathi.W-19425801.guestCustFlow
dannyphan2000
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA video looks good to me
* initial changes * tests and other adjustments * fix to eliminate the OTP modal fluctuating its visibility * clean up code * skip changelog * cleanup the hook * translations * guest flow changes * merge basket change (#3448) * avoid duplicate OTP * tweak for returning vs newly regstered guest users * tests and lint * minor changes * address code review comment * fix lint in commerce-sdk-react * refactor minor --------- Co-authored-by: kumaravinashcommercecloud <[email protected]>
* initial changes * tests and other adjustments * fix to eliminate the OTP modal fluctuating its visibility * clean up code * skip changelog * cleanup the hook * translations * guest flow changes * merge basket change (#3448) * avoid duplicate OTP * tweak for returning vs newly regstered guest users * tests and lint * minor changes * address code review comment * fix lint in commerce-sdk-react * refactor minor --------- Co-authored-by: kumaravinashcommercecloud <[email protected]>
* initial changes * tests and other adjustments * fix to eliminate the OTP modal fluctuating its visibility * clean up code * skip changelog * cleanup the hook * translations * guest flow changes * merge basket change (#3448) * avoid duplicate OTP * tweak for returning vs newly regstered guest users * tests and lint * minor changes * address code review comment * fix lint in commerce-sdk-react * refactor minor --------- Co-authored-by: kumaravinashcommercecloud <[email protected]>
Description
Guest shopper now will see an OTP modal when the opt to register. On successful auth, the shopper is registered and they can place order. Their shipping address, billing phone and payment will be saved when they click place order.
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization